package interfaz;

import javax.swing.JPanel;
import java.awt.Frame;
import javax.swing.JDialog;

import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.GridLayout;
import java.awt.Toolkit;

import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.WindowConstants;

public class Fusion extends JDialog {

	private static final long serialVersionUID = 1L;
	private JPanel jContentPane = null;
	private JScrollPane jScrollPane = null;
	private JTextPane jTextPane = null;

	/**
	 * @param owner
	 */
	public Fusion(Frame owner,String texto) {
		super(owner);
		initialize(texto);
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize(String texto) {
		this.setBounds(new Rectangle(0, 0, 450, 228));
		Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
		double fil=dim.getWidth();
		double col=dim.getHeight();
		fil=(fil-450)/2;
		col=(col-228)/2;
		this.setLocation((int)fil, (int)col);
		this.setTitle("Texto fusionado");
		this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		this.setContentPane(getJContentPane());
		this.getJTextPane().setText(texto);
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			GridLayout gridLayout = new GridLayout();
			gridLayout.setRows(1);
			jContentPane = new JPanel();
			jContentPane.setLayout(gridLayout);
			jContentPane.add(getJScrollPane(), null);
		}
		return jContentPane;
	}

	/**
	 * This method initializes jScrollPane	
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	private JScrollPane getJScrollPane() {
		if (jScrollPane == null) {
			jScrollPane = new JScrollPane();
			jScrollPane.setViewportView(getJTextPane());
		}
		return jScrollPane;
	}

	/**
	 * This method initializes jTextPane	
	 * 	
	 * @return javax.swing.JTextPane	
	 */
	private JTextPane getJTextPane() {
		if (jTextPane == null) {
			jTextPane = new JTextPane();
			jTextPane.setEditable(false);
		}
		return jTextPane;
	}

}  //  @jve:decl-index=0:visual-constraint="3,0"
